Imports Spring.Context
Imports Spring.Context.Support

Public Class BaseDominio
    Implements IRepositorio

    Private _id As Nullable(Of Long)
    Public Overridable Property Id() As Nullable(Of Long)
        Get
            Return _id
        End Get
        Set(ByVal value As Nullable(Of Long))
            _id = value
        End Set
    End Property

    Private _repositorio As IRepositorio
    Protected Overridable Property Repositorio() As IRepositorio
        Get
            Return _repositorio
        End Get
        Set(ByVal value As IRepositorio)
            _repositorio = value
        End Set
    End Property

    Public Sub New()
        'Console.WriteLine("Injecting")
        Dim _contextoDoSpring As IApplicationContext = ContextRegistry.GetContext()
        Dim _repositorio As IRepositorio

        _repositorio = DirectCast(_contextoDoSpring("Acesso.Repositorio"), IRepositorio)
        Me.Repositorio = _repositorio

    End Sub

#Region "Classes Injetadas"


    'FIM
Protected Overridable Property UsuarioDao() As IUsuarioDao Implements IRepositorio.UsuarioDao
    Get
        Return Me.Repositorio.UsuarioDao
    End Get
    Set(ByVal value As IUsuarioDao)

    End Set
End Property


Protected Overridable Property PapelDao() As IPapelDao Implements IRepositorio.PapelDao
    Get
        Return Me.Repositorio.PapelDao
    End Get
    Set(ByVal value As IPapelDao)

    End Set
End Property


Protected Overridable Property SenhaDao() As ISenhaDao Implements IRepositorio.SenhaDao
    Get
        Return Me.Repositorio.SenhaDao
    End Get
    Set(ByVal value As ISenhaDao)

    End Set
End Property


#End Region

End Class
